package com.wei.ssm.dao;

import com.wei.ssm.domain.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author wei
 */
public interface IProductDao {

    @Select("select * from product")
    public List<Product> findAll() throws Exception;

    @Insert("insert into product(productNum,productName,departureTime,cityName,productPrice,productStatus,productDesc) values(#{productNum},#{productName},#{departureTime},#{cityName},#{productPrice},#{productStatus},#{productDesc})")
    void save(Product product);

    @Select("select * from product where id = #{id}")
    Product findById(int id) throws Exception;
}
